<?php
//文件上传使用示例 2009-07-16
@header ( "content-Type: text/html; charset=UTF-8" );
include_once 'include/UploadFile.class.php';//载入文件上传类
if ('upload' == $_POST ['act']) {
	$upfile = $_FILES ['img_up'];//img_up为上传的file值
	$up = new UploadFile ( );//实例化
	$up->allow_types = 'jpg|gif';//设置允许上传的文件格式
	$up->sava_path = 'uplosadssss/';//设置文件上传路径
	$up->upLoad ( $upfile );
	echo $up->errmsg;//输出错误信息 包含成功信息
	echo $up->uploaded_file_path;//获取上传后的文件路径
}

?>
<form id="form1" name="form1" enctype="multipart/form-data"
	method="post">
	<input type="file" name="img_up" id="img_up" /> 
	<input	type="hidden" name="act" value="upload" /> 
	<input type="submit"	name="button" id="button" value="提交" />
</form>

